﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using WalkingTec.Mvvm.Core;

namespace K9Nano.IM.Models
{
    public class ChatSession : BasePoco
    {
        [Display(Name = "客户")]
        [Required]
        public Guid CustomerId { get; set; }

        [Display(Name = "客户")]
        public virtual User Customer { get; set; }

        [Display(Name = "客服")]
        [Required]
        public Guid StaffId { get; set; }

        [Display(Name = "客服")]
        public virtual User Staff { get; set; }
        
        [Display(Name = "状态")]
        [Required]
        public EChatSessionStatus Status { get; set; }

        [Display(Name = "结束时间")]
        public DateTime? EndTime { get; set; }

        [Display(Name = "评分")]
        [Required]
        public int Score { get; set; }

        [Display(Name = "评论")]
        [Required(AllowEmptyStrings = false)]
        [StringLength(200)]
        public string Comment { get; set; }

        [Display(Name = "来源")]
        [StringLength(50, ErrorMessage = "{0}stringmax{1}")]
        [Required]
        public Guid AppId { get; set; }

        [Display(Name = "来源")]
        public virtual ChatApp App { get; set; }

        public virtual List<ChatMessage> Messages { get; set; }
    }
}